from django.urls import path, register_converter

from apps.users import views
from utils.converters import UsernameConverter

register_converter(UsernameConverter, 'uname')

urlpatterns = [
    path('usernames/<uname:username>/count/', views.CheckUsername.as_view()),
    path('register/', views.RegisterView.as_view()),
    path('login/', views.LoginView.as_view()),
    path('logout/', views.LogoutView.as_view()),
    path('info/', views.UserInfoView.as_view()),
    path('emails/', views.SaveEmailView.as_view()),
    path('emails/verification/', views.EmailsVerify.as_view()),
    path('addresses/create/', views.CreateAddressView.as_view()),
    path('addresses/', views.AddressesView.as_view()),
    path('addresses/<update_title_id>/title/', views.UpdateTitle.as_view()),
    path('addresses/<address_id>/', views.AddressesView.as_view()),
    path('password/', views.UpdatePasswordView.as_view()),
    path('addresses/<default_address_id>/default/', views.UpdateDefault.as_view()),
]
